<template>
  <transition name="el-zoom-in-center">
    <div class="JADP-preview-main">
      <div class="JADP-common-page-header">
        <el-page-header @back="goBack" content="详情" />
        <div class="options">
          <el-button @click="goBack">取 消</el-button>
        </div>
      </div>
      <el-row
        :gutter="15"
        class="word-form main"
        :style="{ margin: '0 auto', width: '100%' }"
      >
        <el-form
          ref="elForm"
          :model="dataForm"
          size="medium"
          label-width="200px"
          label-position="right"
        >
          <template v-if="!loading">
            <el-col :span="12">
              <el-form-item label="姓名" prop="realname">
                <p>{{ dataForm.realname }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="性别" prop="gender">
                <p>
                  {{ getDict("sex", dataForm.gender) }}
                </p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="出生年月" prop="birthday">
                <p>{{ jadp.dateFormat(dataForm.birthday) }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="政治面貌" prop="politicallandscape">
                <p>{{ dataForm.politicallandscape }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="身份证号码" prop="certificatesnumber">
                <p>{{ dataForm.certificatesnumber }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="学历" prop="education">
                <p>{{ getDict("Education", dataForm.education) }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="所学专业" prop="major">
                <p>{{ dataForm.major }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="工作时间" prop="worktime">
                <p>{{ jadp.dateFormat(dataForm.worktime) }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="职称/职务" prop="technicaltitle">
                <p>{{ dataForm.technicaltitle }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="职称专业" prop="xzjob">
                <p>{{ dataForm.xzjob }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="技能等级" prop="skilllevel">
                <p>{{ dataForm.skilllevel }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="所任课程" prop="teachingsubjects">
                <p>{{ dataForm.teachingsubjects }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item
                label="从事安全生产培训工作时间"
                prop="safeworktime"
              >
                <p>{{ jadp.dateFormat(dataForm.safeworktime) }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="工作单位" prop="unitname">
                <p>{{ dataForm.unitname }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="专职/兼职" prop="worktype">
                <p>{{ dataForm.worktype | dynamicText(worktypeOptions) }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="邮箱" prop="email">
                <p>{{ dataForm.email }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="详细地址" prop="detailaddress">
                <p>{{ dataForm.detailaddress }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="讲师类型" prop="persontype">
                <p>{{ getDict("headTeacher", dataForm.persontype) }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="安全培训教师岗位证书编号" prop="fixedphone">
                <p>{{ dataForm.fixedphone }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="移动电话" prop="telephone">
                <p>{{ dataForm.telephone }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="个人简历" prop="personalresume">
                <p>{{ dataForm.personalresume }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="主要教学科研成果" prop="scientific">
                <p>{{ dataForm.scientific }}</p>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="备注" prop="remarks">
                <JADP-UploadFz
                  v-model="dataForm.remarks"
                  disabled
                  detailed
                  :showTip="true"
                  :fileSize="5"
                  sizeUnit="MB"
                  :limit="9"
                  buttonText="附件上传"
                >
                </JADP-UploadFz>
              </el-form-item>
            </el-col>
          </template>
        </el-form>
      </el-row>
    </div>
  </transition>
</template>
<script>
import request from "@/utils/request";
// import PrintBrowse from "@/components/PrintBrowse";
import jadp from "@/utils/jadp";
export default {
  //   components: { PrintBrowse },
  props: [],
  data() {
    return {
      visible: false,
      loading: false,
      printBrowseVisible: false,
      printId: "",
      dataForm: {
        id: "",
        realname: "",
        gender: "",
        birthday: "",
        politicallandscape: "",
        certificatesnumber: "",
        education: "",
        major: "",
        worktime: "",
        technicaltitle: "",
        xzjob: "",
        skilllevel: "",
        teachingsubjects: "",
        safeworktime: "",
        unitname: "",
        worktype: "",
        email: "",
        detailaddress: "",
        fixedphone: "",
        telephone: "",
        personalresume: "",
        scientific: "",
        remarks: [],
        creatoruserid: "",
        creatortime: "",
        lastmodifyuserid: "",
        lastmodifytime: ""
      },
      worktypeOptions: [
        { fullName: "专职", id: "1" },
        { fullName: "兼职", id: "2" }
      ]
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    dataInfo(dataAll) {
      let _dataAll = dataAll;
      _dataAll.remarks = _dataAll.remarks ? JSON.parse(_dataAll.remarks) : [];
      this.dataForm = _dataAll;
    },

    goBack() {
      this.$emit("refresh");
    },
    init(id) {
      this.dataForm.id = id || 0;
      this.visible = true;
      this.$nextTick(() => {
        if (this.dataForm.id) {
          this.loading = true;
          request({
            url:
              "/api/teachersManage/Xy_ks_teachers/detail/" + this.dataForm.id,
            method: "get"
          }).then(res => {
            this.dataInfo(res.data);
            this.loading = false;
          });
        }
      });
    }
  }
};
</script>
<style lang="scss" scoped>
.main {
  p {
    margin-left: 10px !important;
  }
}
</style>
